﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Cole.Entities;
using Cole.Service;


namespace Cole.GUI
{
    public partial class ModificarAlumno : Form
    {
        private IAlumnoBl alumnoBl;
        public ModificarAlumno()
        {
            InitializeComponent();
            if (alumnoBl == null)
            {
                alumnoBl = new AlumnoBl();
            }
        }
        public void Recibir(Alumno alu)
        {
            alumnoBindingSource.DataSource = alu;
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnGuardar_Click(object sender, EventArgs e)
        {
            var alumnoActual = alumnoBindingSource.Current as Alumno;
            if (alumnoActual != null)
            {
                alumnoBl.ModificarAlumno(alumnoActual);
            }
            
        }
    }
}
